//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

//====================================================
// Created     : 2004-1-6
// Author      : FengTao
// Description : Some test functions for BSPInitialize
//====================================================
#include <core.h>
#include "testbsppc.h"

EXTERN_C void CDECL TestBootModule1()
{
    kprintf("======\n");
    kprintf("NumberOfBootModules is %d\n", bsp.uNumberOfBootModules);
    for (uint_t i = 0; i < bsp.uNumberOfBootModules; i++) {
        kprintf("    BootModule[%d]: %s [%x -- %x)\n",
                i, bsp.pBootModules[i].szName,
                bsp.pBootModules[i].region.uBasePageNo,
                bsp.pBootModules[i].region.uLimitPageNo);
    }
    kprintf("Totol: %d BootModules, region [%x -- %x)\n",
            bsp.uNumberOfBootModules,
            bsp.regionOfBootModules.uBasePageNo,
            bsp.regionOfBootModules.uLimitPageNo);
}

EXTERN_C void CDECL TestMemZone1()
{
    kprintf("======\n");
    kprintf("KernelPhysBase is %d\n", bsp.paKernelPhysBase);
    kprintf("KernelImagePhysBase is %d\n", bsp.paKernelImagePhysBase);
    kprintf("InitStack: [%x -- %x)\n",
        bsp.regionOfInitStack.uBasePageNo,
        bsp.regionOfInitStack.uLimitPageNo);
    kprintf("kernelPreferredZoneNo is %d\n", bsp.uKernelPreferredZoneNo);
    kprintf("UserPreferredZoneNo is %d\n", bsp.uUserPreferredZoneNo);
    kprintf("NumberOfMemoryZones is %d\n", bsp.uNumberOfMemoryZones);
    for (uint_t i = 0; i < bsp.uNumberOfMemoryZones; i++) {
        kprintf("    Zone[%d]: [%x -- %x)\n", i,
            bsp.pMemoryZones[i].uBasePageNo,
            bsp.pMemoryZones[i].uLimitPageNo);
    }
    kprintf("NumberOfMemoryHoles is %d\n", bsp.uNumberOfMemoryHoles);
    for (uint_t j = 0; j < bsp.uNumberOfMemoryHoles; j++) {
        kprintf("    Hole[%d]: [%x -- %x)\n", j,
                 bsp.pMemoryHoles[j].uBasePageNo,
                 bsp.pMemoryHoles[j].uLimitPageNo);
    }
}
